package com.ssy.lingxi.product.repository.commodity;

import com.ssy.lingxi.product.entity.commodity.CommodityShop;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * 商品商城中间表持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2020/7/13
 */
public interface CommodityShopRepository extends JpaRepository<CommodityShop,Long>, JpaSpecificationExecutor<CommodityShop> {
    @Transactional
    int deleteCommodityShopByCommodityId(Long commodityId);

    @Transactional
    int deleteCommodityShopByCommodityIdIn(List<Long> commodityIdList);

    List<CommodityShop> findByCommodityIdInAndShopId(List<Long> commodityIdList, Long shopId);
}
